package com.nefu.huiyi.controller;

import com.nefu.huiyi.dto.Result;
import com.nefu.huiyi.entity.StatsEntity;
import com.nefu.huiyi.result.StatsResult;
import com.nefu.huiyi.service.DashboardService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/dashboard")
public class DashboardController {
    @GetMapping("/stats")
    public StatsResult<StatsEntity> getStats() {
        StatsEntity stats = dashboardService.getDashboardStats();
        return StatsResult.success(stats);
    }
    private final DashboardService dashboardService;

    public DashboardController(DashboardService dashboardService) {
        this.dashboardService = dashboardService;
    }


}